package com.example.projeto_edilson;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.tela_inicio);

			Bundle extras = getIntent().getExtras();
			
			String noivo = extras.getString("noivo");
			String noiva = extras.getString("noiva");
			String data = extras.getString("data");
			String endereco = extras.getString("endereco");
			
			TextView noivoTextView = (TextView) findViewById(R.id.textViewNoivo);
			noivoTextView.setText(getString(R.string.textViewNoivo,noivo));
			
			TextView noivaTextView = (TextView) findViewById(R.id.textViewData);
			noivaTextView.setText(getString(R.string.textViewNoivo,noiva));
			
			TextView dataTextView = (TextView) findViewById(R.id.textViewData);
			dataTextView.setText(getString(R.string.textViewData,data));
			
			TextView enderecoTextView = (TextView) findViewById(R.id.textViewLocal);
			enderecoTextView.setText(getString(R.string.endereco,endereco));

		
		
		Button button = (Button) findViewById(R.id.buttonGerenciar);
		
		button.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {
				try {

					
					
					Intent intent = new Intent(MainActivity.this,GerenciarCasamento.class);
					startActivity(intent);
					
				} catch (Exception e) {
					System.out.println("entruo no catch");
					Intent intent = new Intent(MainActivity.this,GerenciarCasamento.class);
				    startActivity(intent);
				}

				
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
